<ul id="rTab" class="shadetabs" style="margin-top: 5px;">
    <li><a href="#" rel="tabcontentR">Resources</a></li>
    <li><a href="#" rel="tabcontentU">Uploaded Resources</a></li>
</ul>
<div class="allround" style="margin-left: 2px;margin-right: 5px">
    <div id="tabcontentR" class="tabcontent">

<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<?php include("addimages.php");?><input name="resourceonly" type="hidden" value="yes" />
<input name="" type="submit" value="Add Images" />
<input type="hidden" name="addimgs" id="addimgs">
</form>
</div>
<div id="tabcontentU" class="tabcontent">
<?php 
$rs= getFileTypes();
$row = mysql_fetch_assoc($rs);
?>
<form action="?page=resource" method="post">
<div id="ermsg"><?php echo $rresult; ?></div>
<table>
	<tr>
	<td>File Type</td>
	<td>
			<select name="file_type"  onchange="asssignFolder(this.value)">
			<?php  do { ?>
				<option value="<?php echo $row["category_id"]?>" ><?php echo $row["category_name"]?></option>
                               
			<?php }while($row = mysql_fetch_assoc($rs))?> 
            <option value="21" >forms</option>
             <option value="99" >team Pictures</option>
			</select>
			<input type="hidden" name="folder" value="images" id="upFolder" />
			<input type="hidden" name="check_uploads" value="yes" /></td>
	</tr>
	<tr>
	<td>Check Upload</td>
	<td><input type="submit" value="Check File Uploaded" /></td>
	</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
    var mytab=new ddtabcontent("rTab") //enter ID of Tab Container
    mytab.setpersist(true) //toogle ptersistence of the tabs' state
    mytab.setselectedClassTarget("link") //"link" or "linkparent"
    mytab.init();
	
	function asssignFolder(val){

		folder ="images";
		switch(val){
			case "7":folder="images";break;
			case "8":folder="audio";break;
			case "9":folder="video";break;
			case "10":
			case "15":folder="docs";break;
			case "14":folder="zip";break;
			case "16":
			case "17":folder="others";break;
                         case "21":folder="forms";break;
						   case "99":folder="forms";break;
		}
		
		document.getElementById("upFolder").value=""+folder;
	}
</script>